﻿@model IEnumerable<Comment>
@{
    Ajax.Dna().Widget()
        .Preview(@<text>
    <ul class="d-post-items">
        @for (int i = 0; i < 10; i++)
        {
            <li><a href="javascript:void(0);">Comment @i text </a></li>
        }
    </ul>
    </text>)
        .Content(@<text>
    @if ((Model != null) && (Model.Count() > 0))
    {
        <ul class="d-post-items">
            @foreach (var comment in Model)
            {
                if (comment.IsPingback)
                {
                    continue;
                }
                <li><a href="@(comment.Article.PermaLink + "#comment_" + comment.ID.ToString())" title="@comment.Body">
                    @(string.IsNullOrEmpty(comment.Body) ? comment.Title : Html.Cut(comment.Body, 50))</a>
                </li>
            }
        </ul>
    }
    else
    {
        <div style="padding: 10px;">
           @Html.Global("publishing", "NoComments")</div>
    }
    </text>)
        .Render();
}
